package com.springboot.satoken.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.satoken.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*
 *DATE:2025/8/1
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select r.path from resource r\n" +
            "\tjoin user_res ur on r.id = ur.res_id\n" +
            "\tjoin sysuser u on u.id = ur.user_id\n" +
            "\twhere u.id = #{userId}")
    List<String> selectResourceByUserId(Long userId);
}
